include .env
NAMESPACE?=bi-service
RELEASE_NAME?=bi-zookeeper
export

install:
	-mkdir build
	USER="\$${USER}" envsubst < values.yaml > build/zookeeper.yaml
	helm upgrade --install -f build/zookeeper.yaml ${RELEASE_NAME} ./charts/zookeeper -n ${NAMESPACE}

uninstall:
	-helm uninstall ${RELEASE_NAME} -n ${NAMESPACE}

zk_client:
	POD_NAME=$$(kubectl get pods --namespace bi-service -l "app.kubernetes.io/name=zookeeper,app.kubernetes.io/instance=bi-zookeeper,app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}") && \
    kubectl exec -it $${POD_NAME} -n ${NAMESPACE} -- zkCli.sh